<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.jimet.server.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	String name = request.getParameter("name");
	String tablo = request.getParameter("tablo");
	
	int tab = Integer.parseInt(tablo);
%>
<div style="width:450px;margin-left:auto;margin-right:auto;display:table;padding-top:50px;">
	<form id="dbForm" method="post" >
<%	
	for(int i = 0; i<tab;i++)
	{
%>
		<input type="text" id="Key<%=i%>"  name="Key<%=i%>"  placeholder="Key<%=i+1%>">
		<input type="text" id="Val<%=i%>"  name="Val<%=i%>"  placeholder="Val<%=i+1%>"><br>

<%}%>
	<input type="hidden" id="tabname"  name="tabname"  value="<%=name%>">
	<input type="hidden" id="tablo"  name="tablo"  value="<%=tablo%>">
	<button class="btn btn-success"  type="button" style="margin-left:185px;" onclick="createDb()">Devam</button>
	</form>
	</div>
	<script>
		function createDb()
		{
			$.ajax({
				  type: "POST",
				  url: "process/createTable.jsp",
				  data: $('#dbForm').serialize(),
				})
				  .done(function( msg ) {
				    alert( "Data Saved: " + msg );
				  });
		}
	</script>